package com.drinkian.authentication.controller;

import com.drinkian.authentication.entity.vo.VRoleListWithUserId;
import com.drinkian.authentication.service.IRoleService;
import com.drinkian.entity.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("role")
public class RoleController {

    @Autowired
    private IRoleService iRoleService;

    @GetMapping("getAllRole")
    public RequestResult getAllRole(){
        return iRoleService.getAllRole();
    }

    @PostMapping("changeUserRole")
    public RequestResult changeUserRole(@RequestBody VRoleListWithUserId vRoleListWithUserId){
        return iRoleService.changeUserRole(vRoleListWithUserId);
    }
}
